//
//  ThirdCellTableViewCell.m
//  product_B
//
//  Created by zyc on 16/5/30.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "ThirdCellTableViewCell.h"
#import "MusicAuthorModel.h"
@implementation ThirdCellTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)cellConfigureWithModel:(CommentModel *)model{
    _head.layer.cornerRadius = 25;
    _head.layer.masksToBounds = YES;
    MusicAuthorModel *user = model.user;
    _authorModel = user;
    [_head sd_setImageWithURL:[NSURL URLWithString:user.web_url]];
    _name.text = user.user_name;
    _date.text = model.input_date;
    _content.text = model.content;
    _praisenum.text = [NSString stringWithFormat:@"%@",model.praisenum];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)];
    _head.userInteractionEnabled = YES;
    [_head addGestureRecognizer:tap];
}

- (void)tapAction:(UITapGestureRecognizer *)tap{
    UserViewController *user = [[UserViewController alloc]init];
    user.modelID = _authorModel.user_id;
    if ([self.delegate respondsToSelector:@selector(click:)]) {
        [self.delegate click:user];
    }
}

@end
